//
// C++ Interface: combobox
//
// Description: 
//
//
// Author: Os3 s.r.l. <xgui@os3.it>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//

namespace xgui
{
    %feature("docstring","derives from :class:`xgui.ViewClass` ") ComboboxClass;
	struct ComboboxClass : public xgui::ViewClass
	{
		ComboboxClass();
		bool isInstanceable();
		std::string const &className();
		xgui::Object * create(xgui::Object * parent, xgui::StringMap &properties);
	
		virtual bool canContain(xgui::ClassInfo * c);
	};
	
    %feature("docstring","**DESCTIPTION**\n\nThe Combobox is a widget that display a combobox input.This class cannot be directly instantiated, but must be created using the :meth:`xgui.Master.CreateCombobox()` function.\n\n**PROPERTIES**\n\n * **text** *(RW):* sets or retrieves the text displayed in the entry part of the combobox\n\n * **selected-item** *(RW):* sets or retrieves the currently selected item of the list part of the combobox.The item is specified as a zero-based index.\n\n * **maxlength** *(RW):* sets or retrieves the maximum length of the entry part text\n\n * **editable** *(RW):* if set to *\"1\"* then the combobx entry part can be manually edited; if set to *\"0\"* text can only be changed chosing an item from the list part.\n\n**EVENTS**\n\n * **onsubmit** *(linked to* :class:`xgui.TextCallback` *):* fired when the enter key is pressed while the combobox widget has the keyboard focus.The string parameter of the callback function is the text of the entry part.\n\n * **onchange** *(linked to* :class:`xgui.TextCallback` *):* fired when the user has taken an action that may have altered text in the entry part of the combobox.The string parameter is the altered entry text.Returning *xgui::EVT_BLOCK* from the callback function prevents the text from change.\n\n * **onselect** *(linked to* :class:`xgui.TextStatusCallback` *):* fired when the user changes the selected item of the list part of the combobox.The string parameter of the callback function is the text of the newly selected item.The status parameter is the zero-based index of the selected item.\n\n**METHODS**\n\n") Combobox;
	class Combobox : public xgui::View
	{
		private:
			Combobox(xgui::Container * parent, bool editable);
			virtual ~Combobox();

		public:
		    %feature("docstring","inserts a text string at the specified position in the entry text\n\nC++::\n\n void insertText ( const std::string & text, int pos )\n\n") insertText;
			void insertText(std::string const &text, unsigned int pos);
			%feature("docstring","appends a text string to the end of the entry text\n\nC++::\n\n void appendText ( const std::string & text );\n\n") appendText;
			void appendText(std::string const &text);
			%feature("docstring","inserts a text string at the beginning of the entry text\n\nC++::\n\n void prependText ( const std::string & text );\n\n") prependText;
			void prependText(std::string const &text);

			%feature("docstring","shows the drop-down list associated with the combobox\n\nC++::\n\n void popup();\n\n") popup;
			void popup();
			%feature("docstring","hide the drop-down list associated with the combobox\n\nC++::\n\n void popdown();\n\n") popdown;
			void popdown();

			%feature("docstring","returns true if the combobox entry part can be edited (i.e.: the text can be manually inserted);false otherwise\n\nC++::\n\n bool isEditable();\n\n") isEditable;
			bool isEditable();
			%feature("docstring","if <editable> is set to true then the combobox entry part can be manually edited; otherwise text can only be changed chosing an item from the list part.\n\nC++::\n\n void setAsEditable(bool editable);\n\n") setAsEditable;
			void setAsEditable(bool editable);

		friend class Master;
		friend struct xguimpl::Combobox;
	};
}

%extend xgui::Combobox {
	%pythoncode {
		def __del__(self):
			if self.valid: self.delPyOwner(self)
	}
}

